package model;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Logger;

/**
 *
 * @author khiem-18.4
 */
public class TPConnection {

    private String driveString;
    private String url;
    private String username;
    private String password;
    private Connection connection;

    public TPConnection()
            throws ClassNotFoundException, SQLException {
        driveString = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
        url = "jdbc:sqlserver://localhost:1433; databasename=tech-pro";
        username = "sa";
        password = "fat123456";

        Class.forName(driveString);
        connection = DriverManager.getConnection(url, username, password);
    }

    public Connection getConnection() {
        return connection;
    }
    private static final Logger LOG = Logger.getLogger(TPConnection.class.getName());
}
